<template>
	<view class="content">
		<view class="">
			<u-charts canvasId="map" chartType="map" :opts="opts"></u-charts>
		</view>
		<view class="">
			<u-charts canvasId="bar" chartType="column" :opts="bar"></u-charts>
		</view>
	</view>
</template>

<script>
	import uCharts from '../../js_sdk/u-charts/u-charts/component.vue';

	export default {
		components: {
			uCharts,
		},
		data() {
			return {
				opts: {
					series: []				},
				bar: {}
			}
		},
		created(){
		const data = {
				"categories": ["2012", "2013", "2014", "2015", "2016", "2017"],
				"series": [{
					"name": "成交量1",
					"data": [15, {
						"value": 20,
						"color": "#f04864"
					}, 45, 37, 43, 34]
				}, {
					"name": "成交量2",
					"data": [30, {
						"value": 40,
						"color": "#facc14"
					}, 25, 14, 34, 18]
				}]
			};
			this.bar = data;
			uni.request({
				url:"",
				dataType:'json',
				success(res){
					// 重新赋值
					this.bar = res.data;
				}
			})
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
